
#include "nx_api.h"

#ifdef __PRODUCT_NETXDUO__
#include "netx_mdns_test.h"
/* Frame (96 bytes) */
static const unsigned char pkt1[96] = {
0x33, 0x33, 0x00, 0x00, 0x00, 0xfb, 0x00, 0x11, /* 33...... */
0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */
0x00, 0x00, 0x00, 0x2a, 0x11, 0xff, 0xfe, 0x80, /* ...*.... */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */
0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */
0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, 0x14, 0xe9, /* ........ */
0x14, 0xe9, 0x00, 0x2a, 0x68, 0xc4, 0x00, 0x00, /* ...*h... */
0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, /* ........ */
0x00, 0x00, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* ..._http */
0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */
0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01  /* cal..... */
};

/* Frame (185 bytes) */
static const unsigned char pkt2[185] = {
0x33, 0x33, 0x00, 0x00, 0x00, 0xfb, 0x00, 0x1e, /* 33...... */
0x8f, 0xb1, 0x7a, 0xd4, 0x86, 0xdd, 0x60, 0x00, /* ..z...`. */
0x00, 0x00, 0x00, 0x83, 0x11, 0x40, 0xfe, 0x80, /* .....@.. */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x1e, /* ........ */
0x8f, 0xff, 0xfe, 0xb1, 0x7a, 0xd4, 0xff, 0x02, /* ....z... */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */
0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, 0x14, 0xe9, /* ........ */
0x14, 0xe9, 0x00, 0x83, 0x30, 0x75, 0x00, 0x00, /* ....0u.. */
0x84, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* ........ */
0x00, 0x03, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* ..._http */
0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */
0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */
0x00, 0x00, 0x11, 0x94, 0x00, 0x0f, 0x0c, 0x43, /* .......C */
0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, 0x34, 0x35, /* anonMF45 */
0x30, 0x30, 0x77, 0xc0, 0x0c, 0x06, 0x72, 0x6f, /* 00w...ro */
0x75, 0x74, 0x65, 0x72, 0xc0, 0x17, 0x00, 0x1c, /* uter.... */
0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x10, /* .....x.. */
0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */
0x02, 0x1e, 0x8f, 0xff, 0xfe, 0xb1, 0x7a, 0xd4, /* ......z. */
0xc0, 0x28, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* .(.!.... */
0x00, 0x78, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, /* .x...... */
0x00, 0x50, 0xc0, 0x37, 0xc0, 0x28, 0x00, 0x10, /* .P.7.(.. */
0x80, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x01, /* ........ */
0x00                                            /* . */
};

/* Frame (155 bytes) */
static const unsigned char pkt3[155] = {
0x33, 0x33, 0x00, 0x00, 0x00, 0xfb, 0x00, 0x11, /* 33...... */
0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */
0x00, 0x00, 0x00, 0x65, 0x11, 0xff, 0xfe, 0x80, /* ...e.... */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */
0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */
0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, 0x14, 0xe9, /* ........ */
0x14, 0xe9, 0x00, 0x65, 0x6c, 0xde, 0x00, 0x00, /* ...el... */
0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, /* ........ */
0x00, 0x00, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* ..._http */
0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */
0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */
0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */
0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */
0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* l....... */
0x11, 0x93, 0x00, 0x1f, 0x0c, 0x43, 0x61, 0x6e, /* .....Can */
0x6f, 0x6e, 0x4d, 0x46, 0x34, 0x35, 0x30, 0x30, /* onMF4500 */
0x77, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* w._http. */
0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */
0x61, 0x6c, 0x00                                /* al. */
};

static MDNS_QUERY_INFO mdns_query = {NX_NULL, "_http._tcp", NX_NULL};

MDNS_TEST_SEQ mdns_basic_ipv6_query[] = {
    {TITLE, "Basic IPv6 query", 16, 0},

    /* Add link local address. */
    {MDNS_LLA_ADD, NX_NULL, 0x00000011, 0x22334456},
    {WAIT, NX_NULL, 0, 5},

    /* Recreate mDNS. */
    {MDNS_RECREATE, "ARMMDNSTest-0", 0, 0},

    /* Add query. */
    {MDNS_QUERY, (char*)&mdns_query, 0, 0},

    /* Check query. */
    {MDNS_CHECK_DATA_V6, (char*)&pkt1[0], sizeof(pkt1), 3},

    /* Inject response. */
    {INJECT, (char*)&pkt2[0], sizeof(pkt2), 0},

    /* Check query with known-answer. */
    {MDNS_CHECK_DATA_V6, (char*)&pkt3[0], sizeof(pkt3), 3},

    /* Delete link local address. */
    {MDNS_LLA_DELETE, NX_NULL, 0, 0},
};

int mdns_basic_ipv6_query_size = sizeof(mdns_basic_ipv6_query) / sizeof(MDNS_TEST_SEQ);

#endif /* __PRODUCT_NETXDUO__  */
